Learn to Program with Small Basic by Majed Marji & Ed Price

Learn to Program with Small Basic by Majed Marji & Ed Price

Author:Majed Marji & Ed Price
Language: eng
Format: epub
Publisher: No Starch Press, Inc.
Published: 2016-04-13T04:00:00+00:00


Create a Gold Rush Game

Let’s create a simple game in which a player uses the arrow keys to move a turtle to collect as many bags of gold as possible (see Figure 11-8). The bag of gold appears at random locations on the grid. If the player doesn’t grab the bag in 2 seconds, it moves elsewhere. Let’s see how fast you can get the turtle to move!

Figure 11-8: Help the turtle grab as many bags of gold as possible.

NOTE

The grid is part of the background image, but we added the x- and y-coordinates in Figure 11-8 to help you understand the numbers used in the code. Refer to this figure to picture how the turtle and the bag of gold move.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.